package com.sunday.player.domain;

import java.io.Serializable;
import java.util.List;

import android.database.Cursor;
import android.os.Parcel;
import android.os.Parcelable;

public class musiclist implements Serializable, Parcelable{
    /**
     * 
     */
    private static final long serialVersionUID = -3267150392770955388L;
    private String _id;
    private String Listid;
    private int listno;
    private String ListName;
    private int count;


    
    private boolean Check = true;
    private List<musicData> musiclist;
    
    
    
    public musiclist(String listname , boolean is , List<musicData> list) {
	this.ListName = listname;
	this.Check = is;
	this.musiclist = list;
    }
    
    public static final Parcelable.Creator<musiclist> CREATOR = new Parcelable.Creator<musiclist>() {

	@Override
	public musiclist createFromParcel(Parcel source) {
		
		return new musiclist(source);
	}

	@Override
	public musiclist[] newArray(int size) {
		return new musiclist[size];
	}


	
    };
    public musiclist(String name , String Id , List<musicData> List) {
	setListName(name);
	setListid(Id);
	setMusiclist(List);
    }
    
    
    public musiclist(Parcel source) {
	ListName = source.readString();
	Listid = source.readString();
	boolean[] arry = null ;
	source.readBooleanArray(arry);
	Check = arry[0];
	source.readTypedList(musiclist, musicData.CREATOR);
    }
    
    public musiclist(Cursor c){
	getCurser(c);
    }
    public void getCurser(Cursor c){
	_id = c.getString(0);
	ListName = c.getString(1);
	Check = ((c.getInt(2) == 0) ? false: true);
    }
    @Override
    public void writeToParcel(Parcel dest, int flags) {
	dest.writeString(ListName);
	dest.writeString(Listid);
	dest.writeBooleanArray(new boolean[]{Check});
	dest.writeList(musiclist);
	
    }
    
    

    public String getListName() {
        return ListName;
    }
    public void setListName(String listName) {
        ListName = listName;
    }
    public String getListid() {
        return _id;
    }
    public void setListid(String listid) {
	_id = listid;
    }
    public List<musicData> getMusiclist() {
        return musiclist;
    }
    public void setMusiclist(List<musicData> musiclist) {
        this.musiclist = musiclist;
    }


    @Override
    public int describeContents() {
	return 0;
    }


    public int getListno() {
	return listno;
    }


    public void setListno(int listno) {
	this.listno = listno;
    }

    public boolean isCheck() {
        return Check;
    }
    public void setCheck(boolean isPlayEnable) {
        this.Check = isPlayEnable;
    }


    public int getCount() {
	return count;
    }


    public void setCount(int count) {
	this.count = count;
    }
    
  
    
}
